package com.xiantm.study.thread.future.jdk;

import com.xiantm.study.thread.future.Data;
import com.xiantm.study.thread.future.RealData;

import java.util.concurrent.Callable;

public class Host {


    public Data request(final int count, char c) {
        System.out.println("    request ("+ count+", "+c +") begin");
        final FutureData futureData = new FutureData(() -> new RealData(count, c));
        new Thread(futureData).start();
        System.out.println("    request ("+ count+", "+c +") end");
        return futureData;
    }
}
